<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>修改密码</title>
<style>
#login {
	margin:0 auto;
	width: 290px;
	height:auto;
	overflow: hidden;
	border: solid 1px #CCCCCC;
}

#login_title {
	width: 100%;
	height: 40px;
	line-height: 40px;
	background-color: #F60;
	text-align: center;
	color:white;
}

.line {
	width: 250px;
	
	line-height: 30px;
	margin-left: 20px;
	text-align: center;
	font-family: 楷体;
}

.line input[type!='button'] {
	width: 150px;
}

.line a {
	font-size: 12px;
	color: black;
}

.line span {
	color: #F00;
}

#log_submit {
	display: block;
	width: 80px;
	height: 22px;
	
}
</style>
</head>


<body>
	<form action="#" method="post">
		<div id="login">
			<div id="login_title">修改密码</div>

			<div class="line">
				<span id="msg"></span>
			</div>
			<div class="line">
				原密码&nbsp;&nbsp; <input id="oldpwd" type="password"  placeholder="请输入原密码" />
			</div>
			<div class="line">
				新密码&nbsp;&nbsp; <input id="newpwd" type="password" placeholder="请输入新密码" />
			</div>
			
			<div class="line">
				密码确认&nbsp;&nbsp; <input id="repwd" type="password" placeholder="请再一次输入密码" />
			</div>
			<div class="line">
				<input id="btn_modify" type="button" value="修改"><input id="btn_back" type="button" value="返回">
			</div>
		</div>
	</form>
	
	<!-- 引入jquery.js -->
	<script type="text/javascript" src="static/scripts/jquery.js"></script>
	
	
	<script type="text/javascript">
		$(function(){ //当页面加载完成时，执行回调函数
			$("#btn_modify").bind("click",function(){
				var oldPwd = $("#oldpwd").val();
				var newPwd = $("#newpwd").val();
				var url = "user/modifyPwd";
				$.getJSON(url,{"oldPwd" : oldPwd, "newPwd" : newPwd},function(data){
					if(data.flag){
						//console.log(data.msg);
						$("#msg").html(data.msg);
					}
					else{
						//console.log(data.msg);
						$("#msg").html(data.msg);
					}
				});
			});
			
		});
	
	</script>
</body>
</html>